<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>智慧校园主页</title>
    <link rel="stylesheet" href="/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">青鳥</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>

            <li class="layui-nav-item layui-hide-xs"><a href="">首页</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="">走进青鳥</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="">学校资讯</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">学生风采</a>
                <dl class="layui-nav-child">
                    <dd><a href="">艺术节</a></dd>
                    <dd><a href="">运动会</a></dd>
                    <dd><a href="">节日晚会</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                    个人中心
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:toJumpByGet('/student/StudentDetail.html')">查看个人信息</a></dd>
                    <dd><a href="/LoginOff.html">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a href="javascript:;">
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <!--<li class="layui-nav-item layui-nav-itemed">-->
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">学生之家</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpByGet('/student/XXX.html')">公告</a></dd>
                        <dd><a href="javascript:toJumpByGet('/student/StudentScore.html')">成绩查询</a></dd>
                        <dd><a href="javascript:toJumpByGet('/student/StudentPhysical.html')">体质健康</a></dd>
                        <dd><a href="javascript:toJumpByGet('/student/StudentAddComment.html')">教师评教</a></dd>
                        <dd><a href="javascript:toJumpByGet('/student/StudentDormitory.html')">室友</a></dd>
                        <dd><a href="javascript:;">座位</a></dd>
                        <dd><a href="javascript:toJumpByGet('/student/StudentDreamSchool.html')">理想学校</a></dd>
                        <dd><a href="javascript:toJumpByGet('/student/StudentClassmates.html')">有缘人</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;" id="mainContent"></div>
    </div>

    <form class="layui-form layui-form-pane" id="studentLogin"  lay-filter="studentLoginInfoFilter" style="display: none">
        <div class="layui-form-item">
            <div class="layui-input-inline">
                <input type="text" name="roleName" autocomplete="off" class="layui-input">
                <input type="text" name="studentName" autocomplete="off" class="layui-input">
            </div>
        </div>
    </form>

</div>
<script src="/layui.js"></script>
<script src="/js/jquery-1.8.3.js"></script>
<script src="/js/toJumpByPost.js"></script>

<script>
    //JS
    layui.use(['element', 'layer','form', 'util'], function(){
        let element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,form=layui.form
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){
                layer.open({
                    type: 1
                    ,title:"欢迎您"
                    ,content: $("#studentLogin")
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                    ,success:function () {
                        $.post("/student/queryMain",function (res) {
                            form.val("studentLoginInfoFilter",{
                                "roleName":res.data.items[0].role.name
                                ,"studentName":res.data.items[0].studentName
                            })
                        })
                    }
                });
            }
        });
    });
</script>
</body>
</html>